from PoProject.pages.BasePage import basePage

from PoProject.locator.home_locator.HomeLocator import indexLocator


class homePage(basePage):

    # 首页搜索
    def index_search(self, text):
        path = "百度首页_搜索功能"
        self.input_text(locator=indexLocator.input_locator, text=text, path=path)
        self.click_element(locator=indexLocator.search_button, path=path)

    # 相关搜索已存在
    def find_search_text(self):
        path = "百度首页_相关搜索文案"
        return self.wait_element_presence(indexLocator.find_search, path=path)
